import os
import configparser
from getBasePath import GetBasePath

base_path = GetBasePath().get_base_path()
config_path = os.path.join(base_path, 'config', 'config.ini')


class GetConfigInfo:

    # 初始化
    def __init__(self, section, option):
        self.section = section
        self.option = option

    # 通过section 和option拿到对应值，若有不懂可以搜一下Python读取配置文件ini
    def get_value(self):
        conf = configparser.ConfigParser()
        conf.read(config_path)
        value = conf.get(self.section, self.option)
        return value


if __name__ == '__main__':
    config = GetConfigInfo('env', 'preissue')
    print(config.get_value())
